home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-02-27 | 1.1 KB | 44 lines | [TEXT/CWIE] |
- /* SK8 © 1997 Apple Computer, Inc.
- This code is protected under the current SK8 License
- See http://sk8.research.apple.com/ for more information
- Apple Research Laboratories
- */
-
- import java.awt.*;
-
- // only called when the original target autohighlights.
-
- class mousedowneventmode extends eventmode {
-
- // slots.
-
- public actor originaltarget = null;
-
- // the main function!
-
- // on idle check if the current actor is no longer the original target.
-
- public void handleidle (Event e) {
- if (sk8.eventactor() == this.originaltarget) {
- if (this.originaltarget.highlight() == false)
- this.originaltarget.sethighlight(true);
- } else {
- if (this.originaltarget.highlight() == true)
- this.originaltarget.sethighlight(false);
- }
- }
-
- // on mouse up, leave the mode and send a mouseup only if the actor to get it
- // is the original target.
-
- public void handlemouseup (Event e) {
- this.exitmode();
- this.originaltarget.sethighlight(false);
- if (sk8.eventactor() == this.originaltarget)
- this.originaltarget.mouseup();
- this.originaltarget = null;
- }
-
-
-
- }